package package1;

 class Dog2 extends Dog{
     public static String thing;
     public String food;
     static {
         thing="玩球球";
     }
     {
         food="西瓜";
     }
     public Dog2(String name,int age ,String color,String thing){
         super(name,age,color);
         this.thing=thing;
     }
     public  void Do(){
         System.out.println(this.name+"喜欢"+this.thing+"和吃"+food);
     }

     @Override
     public String toString() {
         return "Dog2{" +
                 "color='" + color + '\'' +
                 ", name='" + name + '\'' +
                 ", age=" + age + '\''+" , hobby="+this.thing+'\''+ " , "+"food="+this.food+ '\''+
                 '}';
     }
 }
